﻿//INSTANT C# NOTE: Formerly VB.NET project-level imports:
using System.Linq;
using System.Xml.Linq;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Shapes;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;

namespace DataBinding
{
	[ValueConversion(typeof(bool), typeof(Brush))]
	public class IsActiveToBrushConverter : IValueConverter
	{


		public object Convert(object value, System.Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			if (value != null && value is bool)
			{
				if (System.Convert.ToBoolean(value))
				{
					return new SolidColorBrush(Colors.Black);
				}
				else
				{
					return new SolidColorBrush(Colors.LightGray);
				}
			}
			else
			{
				return new SolidColorBrush(Colors.LightGray);
			}
		}

		public object ConvertBack(object value, System.Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			throw new NotImplementedException();
		}
	}

} //end of root namespace